package com.tairanchina.joat;

import com.tairanchina.joat.exception.JoatInstallException;

import java.io.Serializable;

/**
 * Created by 周靖捷 on 2016/10/11.
 */
public abstract class PluginMeta implements Serializable {
    protected String version; //版本
    protected String signature; // 签名
    protected String pluginId; // ID
    protected PluginInstallMode installMode; // 安装模式
    protected Class<? extends Plugin> pluginType; // 类型

    public abstract Plugin install(PluginManagerDe manager) throws JoatInstallException; //执行安装

    public abstract boolean uninstall(PluginManagerDe manager) throws JoatInstallException; //执行卸载

    public PluginMeta(String version, String signature, String pluginId, PluginInstallMode installMode, Class<? extends Plugin> pluginType) {
        this.version = version;
        this.signature = signature;
        this.pluginId = pluginId;
        this.installMode = installMode;
        this.pluginType = pluginType;
    }

    public PluginMeta(){

    }

    public String getVersion() {
        return version;
    }

    public String getSignature() {
        return signature;
    }

    public String getPluginId() {
        return pluginId;
    }

    public PluginInstallMode getInstallMode() {
        return installMode;
    }

    public Class<? extends Plugin> getPluginType() {
        return pluginType;
    }
}
